Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add source to the OperatorRewarded event #3136

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

NingLin-P
Copy link
Member

This PR adds source to the OperatorRewarded event (e.g. which consensus block the bundle fee comes from) along with a minor fix to the consensus test runtime.

Code contributor checklist:

Signed-off-by: linning <linningde25@gmail.com>
…ith the production runtime

Signed-off-by: linning <linningde25@gmail.com>
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but I want to double-check the compilation conditions for the Dummy variant.

at_block_number: Number,
},
XDMProtocolFees,
#[cfg(any(feature = "std", feature = "runtime-benchmarks"))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this dummy is only used in tests and benchmarks, so I’m not sure we want it enabled for all std code?

Suggested change
#[cfg(any(feature = "std", feature = "runtime-benchmarks"))]
#[cfg(any(test, feature = "runtime-benchmarks"))]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered using test but interestingly it doesn't compile...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s concerning, because I can only see Dummy used inside test and feature = "runtime-benchmarks" in this PR. So #[cfg(any(test, feature = "runtime-benchmarks"))] should be enough to make it compile.

What’s the exact compile error?
Is that something you can check, or would you like me to?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see why this happens. subspace-test-service is compiled as a production binary, not a #![cfg(test)] binary.

We could fix this by adding a new feature to sp-domains, and making the test crates depend on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants